cmake_minimum_required(VERSION 3.20)
project(learn_opencv)

aux_source_directory(. ROOT)
set(CMAKE_CXX_STANDARD 14)
# 指定opencv的目录地址
set(OpenCV_DIR D:/opencv/mingw/install)
set(benchmark_DIR D:/google-benchmark/install)
#set(OpenCV_DIR E:\\OpenCv\\opcv_mingw\\install)

set(CMAKE_EXE_LINKER_FLAGS "-static")
set(CMAKE_FIND_LIBRARY_SUFFIXES ".a")
add_library(OpenCV STATIC IMPORTED)

#查找指定版本的opencv
find_package(OpenCV 4 REQUIRED)
#find_package(benchmark REQUIRED)

#引入opencv头文件
include_directories(
        img
        ${OpenCV_INCLUDE_DIR}
)

add_executable(learn_opencv
        ${ROOT}
        )
#链接opencv_lib
target_link_libraries(
        learn_opencv
        ${OpenCV_LIBS}
)

message(STATUS "OpenCV LIB STATUS")
message(STATUS "    version ${OpenCV_VERSION}")
message(STATUS "    libraries ${OpenCV_LIBS}")
message(STATUS "    include path ${OpenCV_INCLUDE_DIRS}")
